<template>
  <el-dialog
    custom-class="check-group-dialog"
    :visible.sync="visible"
    width="56%"
    :before-close="handleClose">
    <div slot="title">
      选择群
    </div>
    <div class="check-group-main">
      <div class="check-group-item">
        <div class="item-head">
          <el-input class="search-input" size="small" placeholder="搜索企微号" suffix-icon="el-icon-search" />
        </div>
      </div>
      <div class="check-group-item">
        <div class="item-head">
          <span class="title">筛选条件</span>
          <span class="btn-text">重置条件</span>
        </div>
        <div class="search-list">
          <div class="filter-item">
            <div class="head">搜索关键词</div>
            <el-input class="search-input" size="small" placeholder="输入群名关键词" suffix-icon="el-icon-search" />
          </div>
          <div class="filter-item">
            <div class="head">群人数</div>
            <el-dropdown placement="bottom">
              <el-input class="search-input" size="small" suffix-icon="el-icon-arrow-down" />
              <el-dropdown-menu slot="dropdown">
                <div class="threshold-content">
                  <div class="input-rows">
                    <el-input placeholder="最小值" style="width: 88px"/>
                    <span class="delimiter">~</span>
                    <el-input placeholder="最大值" style="width: 88px"/>
                  </div>
                  <el-button class="submit-button" type="primary" size="small">确定</el-button>
                </div>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
          <div class="filter-item">
            <div class="head">群标签</div>
            <el-dropdown placement="bottom">
              <el-input class="search-input" size="small" suffix-icon="el-icon-arrow-down" />
              <el-dropdown-menu slot="dropdown">
                <div class="tags-dropdown">
                  <div class="dropdown-head">
                    <el-radio-group v-model="radio">
                      <el-radio :label="1">
                        <span style="font-size: 14px;font-weight: 400;">满足任意一个选中标签</span>
                      </el-radio>
                      <el-radio :label="2">
                        <span style="font-size: 14px;font-weight: 400;">同时满足所有选中标签</span>
                      </el-radio>
                    </el-radio-group>
                  </div>
                  <div class="dropdown-body">
                    <el-input class="search-input" size="small" placeholder="搜索标签/标签组" suffix-icon="el-icon-search" />
                    <div class="tag-record">
                      <div class="tag-head">标签标题</div>
                      <div class="tags-item">
                        <div class="tag active">标签一</div>
                        <div class="tag">标签二</div>
                        <div class="tag">标签三</div>
                        <div class="tag">标签四</div>
                      </div>
                    </div>
                    <div class="tag-record">
                      <div class="tag-head">标签标题</div>
                      <div class="tags-item">
                        <div class="tag">标签一</div>
                        <div class="tag">标签二</div>
                        <div class="tag">标签三</div>
                        <div class="tag">标签四</div>
                      </div>
                    </div>
                  </div>
                  <div class="dropdown-footer">
                    <div class="unkown-button">未打标签</div>
                  </div>
                </div>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </div>
      </div>
      <div class="check-group-item">
        <div class="item-head">
          <div class="check-box">
            <el-checkbox>
              <span class="title" style="margin-left: 12px;">群名称</span>
            </el-checkbox>
          </div>
        </div>
      </div>
      <div class="check-group-item">
        <div class="item-head">
          <span class="title">已选择群（0）</span>
          <span class="btn-text">清空</span>
        </div>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="onHandleClose">取消</el-button>
      <el-button type="primary" @click="onSubmit">确定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      tableData: []
    }
  },
  props: ['visible'],
  methods: {
    onHandleClose() {
      this.$emit('onHandleClose');
    },
    onSubmit() {
      this.$emit('onHandleClose');
    }
  }
}
</script>
<style lang="scss" scoped>
.check-group-main {
  display: grid;
  grid-template-columns: 200px 200px 400px 200px;
  min-height: 540px;
  .check-group-item {
    &:not(:last-child) {
      border-right: 1px solid #e9e9e9;
    }
    .item-head {
      background: #fafafa;
      border-bottom: 1px solid #e9e9e9;
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 12px;
      .title {
        font-size: 14px;
        font-weight: 600;
        line-height: 22px;
      }
      .btn-text {
        color: #3070ff;
        text-decoration: none;
        background-color: transparent;
        outline: none;
        cursor: pointer;
        transition: color .3s;
      }
    }
    .search-list {
      padding: 8px 8px;
      .filter-item {
        margin-bottom: 8px;
        .head {
          font-size: 14px;
          color: rgba(0, 0, 0, .85);
          margin-bottom: 8px;
        }
      }
    }
  }
}
</style>
<style>
.check-group-dialog .el-dialog__body {
  padding: 0 !important;
}
.threshold-content {
  padding: 12px;
}
.input-rows {
  display: flex;
  align-items: center;
}
.input-rows .delimiter {
  margin: 0 8px;
  font-size: 14px;
  color: rgba(0,0,0,.25);
}
.threshold-content .submit-button {
  width: 100%;
  margin-top: 12px;
}
.tags-dropdown {
  width: 450px;
  font-size: 14px;
  font-weight: 400;
}
.tags-dropdown .dropdown-head{
  padding: 12px 16px;
  border-bottom: 1px solid #e9e9e9;
}
.dropdown-body {
  padding: 12px;
}
.dropdown-body .tag-record {
  margin-top: 16px;
}
.tag-record .tag-head {
  font-size: 12px;
  color: #666;
}
.tag-record .tags-item {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  column-gap: 8px;
  row-gap: 8px;
  text-align: center;
}
.tags-item .tag {
  margin-bottom: 8px;
  margin-right: 8px;
  font-size: 14px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, .06);
  border-radius: 2px;
}
.tags-item .active {
  background-color: #2f54eb;
  color: #fff;
}
.dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f5f5f5;
  padding: 10px 16px;
  border-top: 1px solid #e9e9e9;
}
.dropdown-footer .unkown-button {
  color: #3070ff;
  border: 1px solid #3070ff;
  border-radius: 4px;
  text-shadow: none;
  font-size: 14px;
  line-height: 22px;
  width: 88px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>